home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 1 / CU Amiga Magazine CD-ROM Special Edition (1995)(EMAP Images)(GB)[Issue 1995-11].iso / Aminet / comm / tcp / AmiTCPsdk_40.lha / AmiTCP-4.0 / netinclude / protocols / dumprestore.h next >
C/C++ Source or Header  |  1994-10-05  |  3KB  |  78 lines

  1. #ifndef PROTOCOLS_DUMPRESTORE_H
  2. #define PROTOCOLS_DUMPRESTORE_H \
  3.        "$Id: dumprestore.h,v 4.1 1994/10/05 23:17:11 ppessi Exp $"
  4. /*
  5.  *      Remote tape protocol
  6.  *
  7.  *      Copyright © 1994 AmiTCP/IP Group,
  8.  *                       Network Solutions Development, Inc.
  9.  *                       All rights reserved.
  10.  */
  11.  
  12. /*
  13.  * TP_BSIZE is the size of file blocks on the dump tapes.
  14.  * Note that TP_BSIZE must be a multiple of DEV_BSIZE.
  15.  *
  16.  * NTREC is the number of TP_BSIZE blocks that are written
  17.  * in each tape record. HIGHDENSITYTREC is the number of
  18.  * TP_BSIZE blocks that are written in each tape record on
  19.  * 6250 BPI or higher density tapes.
  20.  *
  21.  * TP_NINDIR is the number of indirect pointers in a TS_INODE
  22.  * or TS_ADDR record. Note that it must be a power of two.
  23.  */
  24. #define TP_BSIZE    1024
  25. #define NTREC       10
  26. #define HIGHDENSITYTREC    32
  27. #define TP_NINDIR    (TP_BSIZE/2)
  28. #define LBLSIZE        16
  29. #define NAMELEN        64
  30.  
  31. #define OFS_MAGIC       (int)60011
  32. #define NFS_MAGIC       (int)60012
  33. #define CHECKSUM    (int)84446
  34.  
  35. union u_spcl {
  36.     char dummy[TP_BSIZE];
  37.     struct    s_spcl {
  38.         long    c_type;            /* record type (see below) */
  39.         time_t    c_date;            /* date of previous dump */
  40.         time_t    c_ddate;        /* date of this dump */
  41.         long    c_volume;        /* dump volume number */
  42.         daddr_t    c_tapea;        /* logical block of this record */
  43.         ino_t    c_inumber;        /* number of inode */
  44.         long    c_magic;        /* magic number (see above) */
  45.         long    c_checksum;        /* record checksum */
  46.         struct    dinode    c_dinode;   /* ownership and mode of inode */
  47.         long    c_count;        /* number of valid c_addr entries */
  48.         char    c_addr[TP_NINDIR];  /* 1 => data; 0 => hole in inode */
  49.         char    c_label[LBLSIZE];   /* dump label */
  50.         long    c_level;        /* level of this dump */
  51.         char    c_filesys[NAMELEN]; /* name of dumpped file system */
  52.         char    c_dev[NAMELEN];        /* name of dumpped device */
  53.         char    c_host[NAMELEN];    /* name of dumpped host */
  54.         long    c_flags;        /* additional information */
  55.     } s_spcl;
  56. } u_spcl;
  57. #define spcl u_spcl.s_spcl
  58. /*
  59.  * special record types
  60.  */
  61. #define TS_TAPE     1    /* dump tape header */
  62. #define TS_INODE    2    /* beginning of file record */
  63. #define TS_ADDR     4    /* continuation of file record */
  64. #define TS_BITS     3    /* map of inodes on tape */
  65. #define TS_CLRI     6    /* map of inodes deleted since last dump */
  66. #define TS_END      5    /* end of volume marker */
  67.  
  68. /*
  69.  * flag values
  70.  */
  71. #define DR_NEWHEADER    1    /* new format tape header */
  72.  
  73. #define    DUMPOUTFMT    "%-16s %c %s"        /* for printf */
  74.                         /* name, level, ctime(date) */
  75. #define    DUMPINFMT    "%16s %c %[^\n]\n"    /* inverse for scanf */
  76.  
  77. #endif /* !PROTOCOLS_DUMPRESTORE_H */
  78.